package com.hui.stock.service.impl;

import com.hui.stock.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author: ymh
 * @date: 2025/1/13 15:17
 * @description:
 */
@Slf4j
@Service
public class LogServiceImpl implements LogService {

    @Async
    public void recordLog(String userInfo, String uri, String operation, String params, String ip) {
        // 模拟插入日志到数据库
        log.info("Recording log: User={}, URI={}, Operation={}, Params={}, IP={}", userInfo, uri, operation, params, ip);

        // 实际可以插入到数据库，例如：
        // logRepository.save(new LogEntity(userInfo, uri, operation, params, ip));
    }
}
